

local mt = ac.skill['基地设置']
mt.model1 = [[Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl]]

function mt:on_add()
    local unit = self.owner
    unit:set('生命上限',1000)
    unit:set('生命恢复',1)
    unit_add_life2(unit,2)
    self:gc(unit:event '单位-伤害结算前'(function(_,_,target,data)
        if target:is_type('精英') then
            data.current_damage = 20
        elseif target:is_type('领主') then
            data.current_damage = 30
        else
            data.current_damage = 10
        end
        ac.player.self:send_msg('|cffff0000泉水受到攻击！！！|r')
    end))
    self:gc(ac.loop(5*1000,function()
        local selector = ac.selector('unit'):ally(unit):is_not(unit)
        local target = selector:range(unit,600):random()
        if target then
            unit:create_lightning{
                lightning1 = 'HWPB',
                lightning2 = 'HWSB',
                count = 6,
                fade = 2,
                target = target,
                selector = selector,
                func = function(target)
                    target:add_effect(self.model1)
                    target:add('生命',target:get('生命上限')*0.05)
                end,
            }
        end
    end))
    self:gc(unit:event '单位-死亡'(function()
        ac.game:notify('游戏失败')
    end))
end